package demo.using;


import java.util.ArrayList;
import java.util.List;

/**
 * @author : GuoFei
 * @date : 2019/1/4 15:09
 */
public class TTest {



    public static void main(String[] args) {
        List<String> name = new ArrayList<>();
        List<Integer> age = new ArrayList<>();
        List<Number> number = new ArrayList<>();

        name.add("icon");
        age.add(18);
        number.add(314);

        getData(name);
        getData(age);
        getData(number);

    }

    public static  void getData(List<?> data) {
        System.out.println("data :" + data.get(0));
    }

    static class MyClassT<T> implements MyIntT<T>{
        private T tt;

        public MyClassT(T tt) {
            this.tt = tt;
        }

        public T getTt() {
            return tt;
        }

        @Override
        public T test() {
            return null;
        }
    }

    public interface MyIntT<T>{
        public T test();
    }

    public static <T> T genericMethod(Class<T> myClassT) throws IllegalAccessException, InstantiationException {
        T instance = myClassT.newInstance();
        return instance;
    }

    public static class DoubleTT<T ,M> {
        public DoubleTT(T t , M m ) {
            System.out.println(t.getClass().getName());
            System.out.println(m.getClass().getName());
        }
    }

}


